#!/bin/sh
#$Id$
#
#  17-feb-06/xiangyu: restart the run from a VAR file for SWARM model
#  One needs to specify which VAR is going to be copied in the code
#  Example:
#     restart-new-dir-VAR-PVAR ../hydro256e 

/bin/pwd >> $2/data/copied_from.dir
/bin/date >> $2/data/copied_from.dir

procdirs="`\ls data | grep ^proc `"
echo $procdirs
for proc in $procdirs
do
	#echo "cp data/$proc/VAR$1 $2/data/$proc/var.dat"
	mkdir $1/data/$proc
	#cp data/$proc/VAR1 $1/data/$proc/var.dat
	#cp data/$proc/var.dat $1/data/$proc/var.dat
	cp data/$proc/PVAR0 $1/data/$proc/pvar.dat
done
mkdir $1/data/allprocs
cp data/dim.dat $1/data/
cp data/param* $1/data/
cp data/tstalk.dat $1/data/
cp data/pdim.dat $1/data/
cp data/index.pro $1/data/
copy-proc-to-proc grid.dat $1
copy-proc-to-proc dim.dat $1
copy-proc-to-proc proc_bounds.dat $1
copy-proc-to-proc particles_stalker.dat $1
